package com.web.exiaodao.business.entity;

import com.web.exiaodao.business.constant.JConstant;
import com.web.webstart.base.entity.BaseEntity;
import com.web.webstart.base.util.XaUtil;
import com.wordnik.swagger.annotations.ApiModel;
import com.wordnik.swagger.annotations.ApiModelProperty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author eason
 * @ClassName: OrderDetail
 * @Description: 商品-订单详情表定义表
 * @date 2016-11-07 15:15:38
 */
@Entity
@Table(name = "tb_xa_order_detail")
@ApiModel(value = "商品-订单详情表定义表")
public class OrderDetail extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主订单编号,主订单编号")
    private String orderNo;
    @ApiModelProperty(value = "商品ID（货号）,商品ID（货号）,该项目没有具体的SKU")
    private String shop_ProductSPU;
    @ApiModelProperty(value = "规格Values,规格Values,eg(颜色：红色；尺寸：大) 中英文不限制,后台统一处理为英文;或者购买时候商品描述信息|商品简介|商品规格|入住信息等")
    private String standardValues;
    @ApiModelProperty(value = "购买数量,购买数量")
    private Long productNum;
    @ApiModelProperty(value = "商品购买时的价格,商品购买时的价格")
    private Double productOrderPrice;
    @ApiModelProperty(value = "商品的辅助价格（单价的原价或者全额）,商品的辅助价格（单价的原价或者全额）")
    private Double shopOriginalPrice;
    @ApiModelProperty(value = "商品名称,商品名称")
    private String shopName;
    @ApiModelProperty(value = "商品主图,商品主图")
    private String shopUrl;
    @ApiModelProperty(value = "是否评价,是否评价,默认false")
    private Boolean isComm;

    public OrderDetail() {
    }

    public OrderDetail(String shop_ProductSPU, String shopName, String shopUrl, Double productOrder_Price, Long productNum, String standardValues) {
        this.shop_ProductSPU = shop_ProductSPU;
        this.standardValues = standardValues;
        this.productNum = productNum;
        this.productOrderPrice = productOrder_Price;
        this.shopName = shopName;
        this.shopUrl = shopUrl;
    }

    public OrderDetail(String shop_ProductSPU, String shopName, String shopUrl, Double productOrder_Price,  Double shopOriginalPrice, Long productNum, String standardValues) {
        this.shop_ProductSPU = shop_ProductSPU;
        this.standardValues = standardValues;
        this.productNum = productNum;
        this.productOrderPrice = productOrder_Price;
        this.shopOriginalPrice = shopOriginalPrice;
        this.shopName = shopName;
        this.shopUrl = shopUrl;
    }



    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    @Column(nullable = true, length = 50)
    public String getOrderNo() {
        return orderNo;
    }

    public void setShop_ProductSPU(String shop_ProductSPU) {
        this.shop_ProductSPU = shop_ProductSPU;
    }

    @Column(nullable = true, length = 50)
    public String getShop_ProductSPU() {
        return shop_ProductSPU;
    }

    public void setStandardValues(String standardValues) {
        this.standardValues = standardValues;
    }

    @Column(nullable = true, length = 255)
    public String getStandardValues() {
        return standardValues;
    }

    public void setProductNum(Long productNum) {
        this.productNum = productNum;
    }

    @Column(nullable = true, length = 50)
    public Long getProductNum() {
        return productNum;
    }

    public void setProductOrderPrice(Double productOrderPrice) {
        this.productOrderPrice = productOrderPrice;
    }

    @Column(nullable = true, length = 50)
    public Double getProductOrderPrice() {
        return productOrderPrice;
    }

    @Column(nullable = true, length = 50)
    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    @Column(nullable = true, length = 5000)
    public String getShopUrl() {
        return XaUtil.isNotEmpty(shopUrl) ? shopUrl.split(JConstant.SYMBOL_DOT)[0] : null;
    }

    public void setShopUrl(String shopUrl) {
        this.shopUrl = shopUrl;
    }

    @Column(nullable = true, length = 5)
    public Boolean getComm() {
        return XaUtil.getBool(isComm);
    }

    public void setComm(Boolean comm) {
        isComm = comm;
    }

    @Column(nullable = true, length = 50)
    public Double getShopOriginalPrice() {
        return shopOriginalPrice;
    }

    public void setShopOriginalPrice(Double shopOriginalPrice) {
        this.shopOriginalPrice = shopOriginalPrice;
    }
}